﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TEL.WinMediaWPF.Audio
{
    class events
    {
    }
    public class AudioReceiverEventArgs :EventArgs
    {
        public int OrigLength { get; private set; }
        public int CodecLength { get; private set; }
        public string CodecName { get; private set; }
        public string DriverName  { get; private set; }
        public ushort PacketSeq { get; private set; }
        public virtual string message
        {
            get
            {
                return string.Format("Принято {0} байт, декодировано кодеком {1} в {2} байт, проиграно в {3}, Seq Пакета {4}",
                                     OrigLength, CodecName, CodecLength, DriverName, PacketSeq);
            }
        }
        public AudioReceiverEventArgs(string codecName, int origLength, int codecLength, string driverName, ushort packetSeq)
        {
            CodecName = codecName;
            DriverName = driverName;
            CodecLength = codecLength;
            OrigLength = origLength;
            PacketSeq = packetSeq;
        }
    }

    public class AudioSenderEventArgs : AudioReceiverEventArgs
    {
       public override string message
        {
            get
            {
                return string.Format("Считано {0} с устройства {3} байт, кодировано кодеком {1} в {2} байт",
                                     OrigLength, CodecName, CodecLength, DriverName);
            }
        }
        public AudioSenderEventArgs(string codecName, int origLength, int codecLength, string driverName)
            : base(codecName, origLength, codecLength, driverName,0)
        {
           
        }
    }

    public class ErrorEventArgs : EventArgs
    {
        public Exception Error { get; private set; }

        public ErrorEventArgs (Exception error)
        {
            Error = error;
        }
    }

  
    public class MediaLogEventArgs : EventArgs
    {
        public string Info { get; private set; }
        public string Message { get; private set; }

        public MediaLogEventArgs(string info, string message)
        {
            Info = info;
            Message = message;
        }
    }
}
